package com.campus;
import java.util.Scanner;

public class LoginView {
    private LoginService loginService;

    public LoginView() {
        this.loginService = new LoginService();
    }

    public void display() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入用户名: ");
        String username = scanner.nextLine();
        System.out.print("请输入密码: ");
        String password = scanner.nextLine();

        if (loginService.validateUser(username, password)) {
            System.out.println("登录成功！");
        } else {
            System.out.println("用户名或密码错误！");
        }
        scanner.close();
    }
}
